import React, { memo } from 'react';

import { Image } from 'antd';
import createDefaultImage from '../../../../utils/createDefaultImage';

export const SystemIcon = memo(({ v, iconSize = 44 }) => (
  <Image
    width={iconSize}
    height={iconSize}
    preview={false}
    src={
      v.icon ||
      createDefaultImage({
        text: v.name[0],
        w: iconSize,
        fontSize: iconSize / 2,
        h: iconSize,
      }).toDataURL()
    }
  />
));
